Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StatusCode to understand where we are in the game #21

Merged
merged 3 commits into from
May 18, 2024

Conversation

faskowbn
Copy link

@faskowbn faskowbn commented May 5, 2024

Add "StatusCode" to the Schedule model, piping in data we already get in the Schedule DTO. I'd like to use it in my project downstream.

I also add a GameStatus enum. Unfortunately, I don't have access to the MLB documentation, so I'm not quite sure if I'm capturing all potential game statuses -- I feel like I at least captured most of them. If we see an unfamiliar status, I just return null.

I thought about calling "StatusCode" "GameStatusCode", but I figured that it is clear enough we are already in the "Game" context.

Tested with the console app:
Count = 15
Ballpark  string  null

@markjamesm markjamesm self-requested a review May 7, 2024 16:38
@markjamesm markjamesm self-assigned this May 7, 2024
/// </summary>
/// <param name="statusCode">The status code string.</param>
/// <returns>The corresponding GameStatus enum value, or null if the status code is unknown.</returns>
public static GameStatus? GetStatusCode(string? statusCode)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about adding a Utils folder for functions like this, but I didn't want to encroach on the existing folder structure. I'm happy to put this function wherever.

@markjamesm
Copy link
Owner

Hi @brfaskow looks good to me! I'm merging this PR now. I'll try to have a Nuget build up within the next few days.

@markjamesm markjamesm merged commit c3fb730 into markjamesm:master May 18, 2024
2 of 3 checks passed
@brfaskow
Copy link
Contributor

brfaskow commented May 20, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants